import java.rmi.RemoteException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

import cmpe273.classproject.server.dto.PersonResponse;
import cmpe273.classproject.server.model.Movie;
import cmpe273.classproject.server.model.Person;
import cmpe273.classproject.server.service.MovieServiceImplProxy;

public class Bill extends javax.swing.JFrame {
    MovieServiceImplProxy proxy = new MovieServiceImplProxy();
    /** Creates new form Bill */
    public Bill(int memberID) {
    	Person person;
        initComponents();
        
        try {
        	person = proxy.getPerson(memberID).getPersons()[0];
			List<Movie> movies = Arrays.asList(proxy.getAllOutstandingMoviesByPerson(person.getMemberId()).getMovies());
	        memberIdLbl.setText(person.getEmailId());
	        memberNameLbl.setText(person.getFirstName() + " " + person.getLastName());
			Calendar cal = Calendar.getInstance();
			cal.add(Calendar.DATE, 30);
			person.setDueDate(cal);
			Date date = new Date(cal.getTimeInMillis());
	        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
	        dueDatelbl.setText(df.format(date));
	        if(person.getType() == 1)
	        	membertypeLbl.setText("Simple");
	        if(person.getType() == 2)
	        	membertypeLbl.setText("Premium");
	        movieAmount.setText("Member has "+movies.size()+" outstanding movies.");
	        amountDue.setText("$ " + person.getBalance());
	        
	        for(Movie m : movies) {
	        	outstandingMovies.setText(m.getMovieName());
	        }
		} catch (RemoteException e) {
			JOptionPane.showMessageDialog(this, "Connection to server failed. Try again later.");
			this.dispose();
		}
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        movieAmount = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        dueDatelbl = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        memberIdLbl = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        memberNameLbl = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel3 = new javax.swing.JLabel();
        outstandingMovies = new javax.swing.JTextArea();
        jSeparator2 = new javax.swing.JSeparator();
        amountDue = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        membertypeLbl = new javax.swing.JLabel();
        cancelBtn = new javax.swing.JButton();
        saveBtn = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));

        movieAmount.setText("Movies");

        jLabel1.setText("Due date:");

        dueDatelbl.setText("xxx");

        jLabel2.setText("Member id:");

        memberIdLbl.setText("xxx");

        jLabel4.setText("Member name:");

        memberNameLbl.setText("xxx");

        jSeparator1.setForeground(new java.awt.Color(0, 0, 0));

        jLabel3.setText("Amount due:");

        outstandingMovies.setColumns(20);
        outstandingMovies.setEditable(false);
        outstandingMovies.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N
        outstandingMovies.setRows(5);
        outstandingMovies.setBorder(null);

        jSeparator2.setForeground(new java.awt.Color(0, 0, 0));

        amountDue.setText("xxx");

        jLabel6.setText("Member type:");

        membertypeLbl.setText("xxx");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(outstandingMovies, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jSeparator2, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
                            .addContainerGap())
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel4)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(jLabel2)
                                            .addGap(28, 28, 28)))
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                            .addComponent(memberIdLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 167, Short.MAX_VALUE)
                                            .addComponent(jLabel1)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(dueDatelbl, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(14, 14, 14))
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(memberNameLbl)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 387, Short.MAX_VALUE))
                                        .addComponent(membertypeLbl, javax.swing.GroupLayout.Alignment.LEADING))))
                            .addContainerGap(10, Short.MAX_VALUE))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 314, Short.MAX_VALUE)
                            .addComponent(amountDue, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(59, 59, 59))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel6)
                            .addContainerGap(429, Short.MAX_VALUE))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(movieAmount)
                            .addContainerGap(463, Short.MAX_VALUE)))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(dueDatelbl, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(memberIdLbl))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(memberNameLbl))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(membertypeLbl))
                .addGap(31, 31, 31)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(amountDue))
                .addGap(18, 18, 18)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(movieAmount)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(outstandingMovies, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE)
                .addContainerGap())
        );

        cancelBtn.setText("Cancel");
        cancelBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelBtnActionPerformed(evt);
            }
        });

        saveBtn.setText("Save");
        saveBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(335, 335, 335)
                .addComponent(saveBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cancelBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(10, 10, 10))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cancelBtn)
                    .addComponent(saveBtn))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>

    private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) {
        this.dispose();
    }

    private void saveBtnActionPerformed(java.awt.event.ActionEvent evt) {

        
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
            	try {
		UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
	} catch (Throwable e) {
	}
     
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.JLabel amountDue;
    private javax.swing.JButton cancelBtn;
    private javax.swing.JLabel dueDatelbl;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JLabel memberIdLbl;
    private javax.swing.JLabel memberNameLbl;
    private javax.swing.JLabel membertypeLbl;
    private javax.swing.JLabel movieAmount;
    private javax.swing.JTextArea outstandingMovies;
    private javax.swing.JButton saveBtn;
    // End of variables declaration
}

//
//
//
//import java.rmi.RemoteException;
//import java.text.DateFormat;
//import java.text.SimpleDateFormat;
//import java.util.Arrays;
//import java.util.Calendar;
//import java.util.Date;
//import java.util.List;
//
//import javax.swing.JOptionPane;
//import javax.swing.UIManager;
//
//import cmpe273.classproject.server.model.Movie;
//import cmpe273.classproject.server.model.Person;
//import cmpe273.classproject.server.service.MovieServiceImplProxy;
//
//public class Bill extends javax.swing.JFrame {
//    MovieServiceImplProxy proxy = new MovieServiceImplProxy();
//    /** Creates new form Bill */
//    public Bill(Person person) {
//        initComponents();
//        
//        try {
//			List<Movie> movies = Arrays.asList(proxy.getAllOutstandingMoviesByPerson(person.getMemberId()).getMovies());
//	        memberIdLbl.setText(person.getEmailId());
//	        memberNameLbl.setText(person.getFirstName() + " " + person.getLastName());
//			Calendar cal = Calendar.getInstance();
//			cal.add(Calendar.DATE, 30);
//			person.setDueDate(cal);
//			Date date = new Date(cal.getTimeInMillis());
//	        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
//	        dueDatelbl.setText(df.format(date));
//	        if(person.getType() == 1)
//	        	membertypeLbl.setText("Simple");
//	        if(person.getType() == 2)
//	        	membertypeLbl.setText("Premium");
//	        movieAmount.setText("Member has "+movies.size()+" outstanding movies.");
//	        amountDue.setText("$ " + person.getBalance());
//	        
//	        for(Movie m : movies) {
//	        	outstandingMovies.setText(m.getMovieName());
//	        }
//		} catch (RemoteException e) {
//			JOptionPane.showMessageDialog(this, "Connection to server failed. Try again later.");
//			this.dispose();
//		}
//    }
//
//    /** This method is called from within the constructor to
//     * initialize the form.
//     * WARNING: Do NOT modify this code. The content of this method is
//     * always regenerated by the Form Editor.
//     */
//    @SuppressWarnings("unchecked")
//    // <editor-fold defaultstate="collapsed" desc="Generated Code">
//    private void initComponents() {
//
//        jPanel1 = new javax.swing.JPanel();
//        movieAmount = new javax.swing.JLabel();
//        jLabel1 = new javax.swing.JLabel();
//        dueDatelbl = new javax.swing.JLabel();
//        jLabel2 = new javax.swing.JLabel();
//        memberIdLbl = new javax.swing.JLabel();
//        jLabel4 = new javax.swing.JLabel();
//        memberNameLbl = new javax.swing.JLabel();
//        jSeparator1 = new javax.swing.JSeparator();
//        jLabel3 = new javax.swing.JLabel();
//        outstandingMovies = new javax.swing.JTextArea();
//        jSeparator2 = new javax.swing.JSeparator();
//        amountDue = new javax.swing.JLabel();
//        jLabel6 = new javax.swing.JLabel();
//        membertypeLbl = new javax.swing.JLabel();
//        backBtn = new javax.swing.JButton();
//
//        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
//
//        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
//
//        movieAmount.setText("Movies");
//
//        jLabel1.setText("Due date:");
//
//        dueDatelbl.setText("xxx");
//
//        jLabel2.setText("Member id:");
//
//        memberIdLbl.setText("xxx");
//
//        jLabel4.setText("Member name:");
//
//        memberNameLbl.setText("xxx");
//
//        jSeparator1.setForeground(new java.awt.Color(0, 0, 0));
//
//        jLabel3.setText("Amount due:");
//
//        outstandingMovies.setColumns(20);
//        outstandingMovies.setEditable(false);
//        outstandingMovies.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N
//        outstandingMovies.setRows(5);
//        outstandingMovies.setBorder(null);
//
//        jSeparator2.setForeground(new java.awt.Color(0, 0, 0));
//
//        amountDue.setText("xxx");
//
//        jLabel6.setText("Member type:");
//
//        membertypeLbl.setText("xxx");
//
//        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
//        jPanel1.setLayout(jPanel1Layout);
//        jPanel1Layout.setHorizontalGroup(
//            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(jPanel1Layout.createSequentialGroup()
//                .addContainerGap()
//                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//                    .addGroup(jPanel1Layout.createSequentialGroup()
//                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
//                            .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
//                            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 486, Short.MAX_VALUE)
//                            .addGroup(jPanel1Layout.createSequentialGroup()
//                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//                                    .addGroup(jPanel1Layout.createSequentialGroup()
//                                        .addComponent(jLabel4)
//                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
//                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
//                                        .addComponent(jLabel2)
//                                        .addGap(28, 28, 28)))
//                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
//                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
//                                        .addComponent(memberIdLbl, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
//                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 167, Short.MAX_VALUE)
//                                        .addComponent(jLabel1)
//                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
//                                        .addComponent(dueDatelbl, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
//                                        .addGap(14, 14, 14))
//                                    .addGroup(jPanel1Layout.createSequentialGroup()
//                                        .addComponent(memberNameLbl)
//                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 387, Short.MAX_VALUE))
//                                    .addComponent(membertypeLbl, javax.swing.GroupLayout.Alignment.LEADING)))
//                            .addComponent(outstandingMovies, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 467, javax.swing.GroupLayout.PREFERRED_SIZE)
//                            .addComponent(movieAmount, javax.swing.GroupLayout.Alignment.LEADING))
//                        .addContainerGap(10, Short.MAX_VALUE))
//                    .addGroup(jPanel1Layout.createSequentialGroup()
//                        .addComponent(jLabel3)
//                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 314, Short.MAX_VALUE)
//                        .addComponent(amountDue, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
//                        .addGap(59, 59, 59))
//                    .addGroup(jPanel1Layout.createSequentialGroup()
//                        .addComponent(jLabel6)
//                        .addContainerGap(429, Short.MAX_VALUE))))
//        );
//        jPanel1Layout.setVerticalGroup(
//            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
//                .addContainerGap()
//                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                        .addComponent(jLabel1)
//                        .addComponent(dueDatelbl, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
//                    .addGroup(jPanel1Layout.createSequentialGroup()
//                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                            .addComponent(jLabel2)
//                            .addComponent(memberIdLbl))
//                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
//                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                            .addComponent(jLabel4)
//                            .addComponent(memberNameLbl))))
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
//                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                    .addComponent(jLabel6)
//                    .addComponent(membertypeLbl))
//                .addGap(31, 31, 31)
//                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
//                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                    .addComponent(jLabel3)
//                    .addComponent(amountDue))
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 91, Short.MAX_VALUE)
//                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
//                .addComponent(movieAmount)
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
//                .addComponent(outstandingMovies, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addContainerGap())
//        );
//
//        backBtn.setText("Back");
//        backBtn.addActionListener(new java.awt.event.ActionListener() {
//            public void actionPerformed(java.awt.event.ActionEvent evt) {
//                backBtnActionPerformed(evt);
//            }
//        });
//
//        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
//        getContentPane().setLayout(layout);
//        layout.setHorizontalGroup(
//            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
//                .addContainerGap(433, Short.MAX_VALUE)
//                .addComponent(backBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addContainerGap())
//            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
//        );
//        layout.setVerticalGroup(
//            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
//                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
//                .addComponent(backBtn)
//                .addContainerGap())
//        );
//
//        pack();
//    }// </editor-fold>
//
//    private void backBtnActionPerformed(java.awt.event.ActionEvent evt) {
//        this.dispose();
//    }
//
//    /**
//     * @param args the command line arguments
//     */
//    public static void main(String args[]) {
//            	try {
//		UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//	} catch (Throwable e) {
//	}
//     
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new Bill(new Person()).setVisible(true);
//            }
//        });
//    }
//    // Variables declaration - do not modify
//    private javax.swing.JLabel amountDue;
//    private javax.swing.JButton backBtn;
//    private javax.swing.JLabel dueDatelbl;
//    private javax.swing.JLabel jLabel1;
//    private javax.swing.JLabel jLabel2;
//    private javax.swing.JLabel jLabel3;
//    private javax.swing.JLabel jLabel4;
//    private javax.swing.JLabel jLabel6;
//    private javax.swing.JPanel jPanel1;
//    private javax.swing.JSeparator jSeparator1;
//    private javax.swing.JSeparator jSeparator2;
//    private javax.swing.JLabel memberIdLbl;
//    private javax.swing.JLabel memberNameLbl;
//    private javax.swing.JLabel membertypeLbl;
//    private javax.swing.JLabel movieAmount;
//    private javax.swing.JTextArea outstandingMovies;
//    // End of variables declaration
//}
